package com.zyw.util;

import java.text.SimpleDateFormat;
import java.util.Date;

public class GenerateOrdersIDUtil {

    public static String generateOrdersID(Integer userId){


        SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss:SSS");//设置日期格式
        String time =  df.format(new Date());// new Date()为获取当前系统时间

        String year = time.substring(0, time.indexOf(" ")).trim();
        String date = time.substring(time.lastIndexOf("-")+3).trim();

        String newYear = year.replace("-", "");
        String newDate = date.replace(":", "");



        return userId+newYear+newDate;

    }


}
